/*
脚本说明:某个用户的日程。
程序员:
*/

//脚本唯一关键字,通过该关键字找到对应脚本，每个脚本必须有该描述。
var v_script_id = 'dc_users';
//脚本状态,0:该脚本不许执行，1:该脚本可以执行
var v_status = '1';

//脚本逻辑写在run语句之间
if (run){
	var authid=11;
	var pcols = action.authority.findPcolvalues(authid);
	var condition = '';
	if (pcols !=null && !pcols.isEmpty()){
		condition = pcols.toString();
		condition = condition.replace('[','');
		condition = condition.replace(']','');
		//[1,2,3,4,5]
		condition = condition.replaceAll(","," or id=");
		condition = "where (id="+condition+") and state!=2 order by id";
		action.vars.put(action.V_TABLE_NAME,'h_auth_users');//指定获取数据的表名
		action.vars.put(action.V_COLUMNS,'id,realname');//字段
		action.vars.put(action.V_CONDITION,condition);//检索条件
	}
}